<!--组件-二级菜单-->
<template>
  <div class="bg">
    <div class="all" v-for="(name, index) in menus" v-bind:key="index" @click="menuClick(index)">
      <div class="but">
        <div :class="['mr20',menu == index ? 'sel-check' : 'unsel-check']"></div>
        <text :class="['font28', 'text', menu == index ? 'text2' : 'text3']">{{name}}</text>
      </div>
    </div>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
  .bg {
    flex-direction: row;
    flex: 1;
    padding-left: 20px;
    padding-right: 20px;
  }

  .but {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding-left: 10px;
    padding-right: 10px;
  }

  .sel-check {
    background-color: #ffffff;
    border-color: #1890ff;
    border-width: 10px;
    border-radius: 16px;
    width: 28px;
    height: 28px;
  }
  .unsel-check {
    background-color: transparent;
    border-color: #777f9b;
    border-width: 2px;
    border-radius: 14px;
    width: 28px;
    height: 28px;
  }
  .text {
    text-align: center;
    lines: 1;
    text-overflow: ellipsis;
  }
</style>

<script>
  export default {
    props: {
      menu: {
        type: Number,
        default: 0,
      },

      menus: {
        type: Array,
        default: [],
      },
    },

    data() {
      return {};
    },

    mounted() {},

    methods: {
      /********************************** 点击触发*/
      menuClick(index) {
        this.$emit("menuClick", index);
      },
    },
  };
</script>
